package ie.dkit.java3Demulation.transforming;

import ie.dkit.java3Demulation.objects3d.Point3D;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Vector;

public class TransformableGroup extends Vector<Transformable> implements
		Transformable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4946546622953812991L;

	private String m_Name;

	private Point3D m_RotationPoint;

	/*
	 * (non-Javadoc)
	 * @see ie.dkit.java3Demulation.transforming.Transformable#getPoints()
	 */
	public Collection<Point3D> getPoints() {
		Collection<Point3D> returnValue = new ArrayList<Point3D>();
		for (Transformable transformable : this) {
			returnValue.addAll(transformable.getPoints());
		}
		return returnValue;
	}

	/*
	 * (non-Javadoc)
	 * @see ie.dkit.java3Demulation.transforming.Transformable#getRotationPoint()
	 */
	public Point3D getRotationPoint() {
		return m_RotationPoint;
	}

	/*
	 * (non-Javadoc)
	 * @see ie.dkit.java3Demulation.transforming.Transformable#setRotationPoint(ie.dkit.java3Demulation.objects3d.Point3D)
	 */
	public void setRotationPoint(Point3D point3D) {
		for (Transformable transformable : this) {
			transformable.setRotationPoint(point3D);
		}
		m_RotationPoint = point3D;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see ie.dkit.java3Demulation.objects.GraphicsObject#getName()
	 */
	public String getName() {
		return m_Name;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see ie.dkit.java3Demulation.objects.GraphicsObject#setName(java.lang.String)
	 */
	public void setName(String name) {
		m_Name = name;
	}

}
